import React, { useEffect } from 'react';
import './index.scss';

type defaultProps = {
    placeholder?: string;
    value?: string; // 值
    disabled?: Boolean;
    onChange?: (v: string) => void; // 更新事件
  };
  
  const EasyInput = (props: defaultProps) => {
    const {
      placeholder = '请输入',
      value = '',
      onChange = () => {},
      disabled = false,
    } = props;
    return (
      <div className="easy_input">
        
          <input
            type="text"
            placeholder={placeholder}
            value={value}
            disabled={disabled ? true : false}
            onInput={(e) => {
              onChange(e.currentTarget.value);
            }}
          />
        
      </div>
    );
  };

export default EasyInput;
